const e = require('express');
const express = require('express');

let appRouter = express.Router();

appRouter.get('/',(req,res)=>{
    res.render('login');
});

appRouter.get('/index',(req,res)=>{
        res.render('index');
});

appRouter.post('/login',(req,res)=>{
    console.log(req.body);
    if(req.body.username=='123'&&req.body.password=='123'){
        console.log(123123);
        req.session.user = true;
        res.render('index');
    }
    else{
        res.render('login');
    }
});


module.exports = appRouter;